<template>
    <div>
      <h2>Sibling Component B</h2>
      <p>Sibling Field A Value: {{ siblingFieldAValue }}</p>
      <button @click="getSiblingData">Get Sibling Data</button>
    </div>
  </template>
  
  <script setup>
  import { ref } from 'vue';
  import { useForm } from '@formily/vue';
  
  // 获取表单实例
  const form = useForm();
  
  // 存储兄弟组件 A 的字段值
  const siblingFieldAValue = ref('');
  
  // 获取兄弟组件数据的方法
  const getSiblingData = () => {
    siblingFieldAValue.value = form.value.getFieldValue('siblingFieldA');
  };
  </script>
  
  <style scoped>
  button {
    margin-top: 5px;
  }
  </style>